home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_bab_radio_chatter.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  100 lines

  1. # Jones 3D Cog Script
  2. #
  3. # gen_radio_chatter.cog
  4. #
  5. # Generic Door Script
  6. #
  7. # [CMG]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.     
  14.     #..................MESSAGES................
  15.     message        startup    
  16.     message        crossed    
  17.     message        pulse    
  18.     
  19.     #..................PROPS................
  20.     thing        soundobj
  21.  
  22.     #..................ACTORS................
  23.     thing        player                                  local
  24.         
  25.     #..................TRIGGERS................
  26.  
  27.     surface        endsurf0                                linkID=3     
  28.     surface        startsurf                                linkID=2     
  29.  
  30.     #..................VARIABLES................
  31.     int            inrange=0                                  local
  32.     int            vol=1                                    local
  33.     int            snd                                        local
  34.     int            chattertime                                local        # int for holding Rand value
  35.     int            i                                        local        # int for for loops
  36.         
  37.     #..................SOUND................
  38.     sound       chatter0=riv_radio_chatter_a1.wav        local
  39.     sound       chatter1=riv_radio_chatter_a2.wav        local
  40.     sound       chatter2=riv_radio_chatter_a3.wav        local
  41.     sound       chatter3=riv_radio_chatter_a4.wav        local
  42.     sound       chatter4=riv_radio_chatter_a5.wav        local
  43.     
  44. end
  45.  
  46. # ========================================================================================
  47.  
  48. code
  49.  
  50. # ........................................................................................
  51. startup:
  52.  
  53.     player = GetLocalPlayerThing();
  54.     Sleep(5);
  55.     chattertime=RandBetween(6, 12);
  56.     SetPulse(chattertime);
  57.     
  58. return;
  59.  
  60. # ........................................................................................
  61. crossed:
  62.  
  63.     if (GetSourceRef() != player) return;
  64.     
  65.     if (GetSenderID() == 2)    # start the sounds
  66.     {
  67.         If (inrange != 0)
  68.         {
  69.             inrange = 0;
  70.         }
  71.         chattertime=RandBetween(6, 12);
  72.         SetPulse(chattertime);
  73.     }
  74.     
  75.     if (GetSenderID() == 3)    # stop the sounds
  76.     {
  77.         If (inrange != 0)
  78.         {
  79.             inrange = 0;
  80.         }
  81.         SetPulse(0);
  82.         //print("radio timer cut");
  83.     }
  84.     
  85. return;
  86.  
  87. # ........................................................................................
  88. pulse:
  89.  
  90.     //print("pulse hit");
  91.     i=RandBetween(0,4);    # choose a sound
  92.     PlaySoundThing(chatter0[i], soundobj, vol, 5, 10, 0x0);
  93.     
  94. return;
  95.  
  96. # ........................................................................................
  97.  
  98. end
  99.  
  100.